package com.dmxtechnologies.community.war;

import java.util.logging.Logger;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.inject.Named;

import com.dmxtechnologies.community.ejb.interfaces.IndexRealTimeBroadcastRemote;
import com.dmxtechnologies.community.rar.api.CMSBaseResponse;

@Named("cmsIndexAccessBean")
@RequestScoped
public class CMSIndexAccessBean {
	private static final Logger log = Logger.getLogger("CMSIndexAccessBean");
	private CMSBaseResponse baseResponse;
	
	public CMSBaseResponse getBaseResponse() {
		return baseResponse;
	}

	public void setBaseResponse(CMSBaseResponse baseResponse) {
		this.baseResponse = baseResponse;
	}
	 
	@EJB
	IndexRealTimeBroadcastRemote broadcastRemote;

	@PostConstruct
	public void init() {
		log.info("start");
		try {
			baseResponse = broadcastRemote.getCarouselList();
		} catch (Exception ex) {
			throw new RuntimeException(ex);
		}
		log.info("end");
	}

}
